<template>
	<view style="background-color: #F4F4F4;">
		<view v-if="okamiList.length>0">
				<hallOkami  v-for="(item,i) in okamiList" :key="i"
				 :avatar_src="item.avatar"
				 :descriptor="item.descriptor"
				 :game_name="item.game"
				 :game_rank="item.rank"
				 :play_name="item.username"
				 :user_id="item.id"
				 :price="item.price"
				 :play_characteristics="item.trait"
				 :unit="item.unit"
				 :sex_age="getSexAge(item)"
				 :tag_type="getTypeBySex(item)"
				 :isService="item.service"
				 />
		</view>
		<view v-else class="no_body"><u-empty text="\n所谓伊人，在水一方\n\n这儿什么内容都没有" mode="list"></u-empty></view>
	</view>
</template>

<script>
	import hallOkami from "@/components/hall_okami/hall_okami.vue"
	export default {
		onLoad(op) {
			if(op.action=='my'){
				uni.setNavigationBarTitle({
					title:'我的发布'
				});
			}
		},
		components:{
			hallOkami
		},
		data() {
			return {
				okamiList:[{
						id:1,
						username:'亲爱的自己',
						sex:'男',
						age:20,
						avatar:'/static/icon/ui/user/avatar/1.png',
						game:'第五人格',
						rank:'一阶',
						trait:'声音好听',
						price:'1.20',
						unit:'币/局',
						descriptor:'带你飞',
						service:false
					},{
						id:2,
						username:'乐乐',
						sex:'女',
						age:21,
						avatar:'/static/icon/ui/user/avatar/2.png',
						game:'王者荣耀',
						rank:'荣耀黄金',
						trait:'温柔可人',
						price:'1.50',
						unit:'币/局',
						descriptor:'后来的我们，一个不愿联系，一个不愿打扰',
						service:true,
					},{
						id:3,
						username:'手心的蔷薇',
						sex:'女',
						age:22,
						avatar:'/static/icon/ui/user/avatar/3.png',
						game:'第五人格',
						rank:'一阶',
						trait:'温柔可人',
						price:'1.20',
						unit:'币/局',
						descriptor:'希望风吹到你的脸，就是我吻你的，而我又在想你了。',
						service:false
					},{
						id:4,
						username:'在线卑微',
						sex:'男',
						age:20,
						avatar:'/static/icon/ui/user/avatar/4.png',
						game:'王者荣耀',
						rank:'王者',
						trait:'大神带飞',
						price:'1.00',
						unit:'币/局',
						descriptor:'谁知道洒脱的人，用了多少时间才哭干了眼泪。',
						service:false
					},{
						id:5,
						username:'琪琪',
						sex:'男',
						age:19,
						avatar:'/static/icon/ui/user/avatar/5.png',
						game:'第五人格',
						rank:'二阶',
						trait:'找盆友',
						price:'1.10',
						unit:'币/局',
						descriptor:'我懂的适可而止和知足，而你什么时候给过我爱和满足。',
						service:true
					},{
						id:6,
						username:'玉儿',
						sex:'男',
						age:18,
						avatar:'/static/icon/ui/user/avatar/6.png',
						game:'王者荣耀',
						rank:'荣耀黄金',
						trait:'组队CP',
						price:'1.90',
						unit:'币/局',
						descriptor:'南墙我撞了，除了自欺欺人什么都没有。',
						service:true
					},{
						id:7,
						username:'不想取昵称',
						sex:'女',
						age:20,
						avatar:'/static/icon/ui/user/avatar/7.png',
						game:'第五人格',
						rank:'三阶',
						trait:'跳绳冠军',
						price:'2.20',
						unit:'币/局',
						descriptor:'小女子不才，明知公子已有心上人，却还是止不住的想要靠近你。',
						service:false
					},{
						id:8,
						username:'大学一年级',
						sex:'女',
						age:21,
						avatar:'/static/icon/ui/user/avatar/8.png',
						game:'王者荣耀',
						rank:'荣耀黄金',
						trait:'声音好听',
						price:'10.20',
						unit:'币/局',
						descriptor:'草在等他的雨，风在追他的云， 我在想我的你。',
						service:false
					},{
						id:9,
						username:'呼呼呼',
						sex:'女',
						age:22,
						avatar:'/static/icon/ui/user/avatar/9.png',
						game:'王者荣耀',
						rank:'荣耀黄金',
						trait:'声音好听',
						price:'12.20',
						unit:'币/局',
						descriptor:'风尘不过一女子， 我也不过一个你。',
						service:false
					},{
						id:10,
						username:'糖糖鸭',
						sex:'男',
						age:21,
						avatar:'/static/icon/ui/user/avatar/10.png',
						game:'第五人格',
						rank:'六阶',
						trait:'声音好听',
						price:'12.10',
						unit:'币/局',
						descriptor:'等到看到这银色满际，等到分不清季节更替，才敢说我喜欢你。',
						service:false
					},{
						id:11,
						username:'清风',
						sex:'男',
						age:22,
						avatar:'/static/icon/ui/user/avatar/11.png',
						game:'和平精英',
						rank:'黄金',
						trait:'声音好听',
						price:'1.22',
						unit:'币/半小时',
						descriptor:'该来的总会来，不该来的，早就来过了。',
						service:false
					},{
						id:12,
						username:'我喜欢可爱的狗狗',
						sex:'女',
						age:21,
						avatar:'/static/icon/ui/user/avatar/12.png',
						game:'第五人格',
						rank:'荣耀黄金',
						trait:'声音好听',
						price:'1.21',
						unit:'币/局',
						descriptor:'从来都没欠过谁 但总是这么狼狈。',
						service:false
					}
				]
			}
		},
		methods: {
			getSexAge(item){
				var str = "";
				if(item.sex=="男"){
					str+="♂";
				}else if(item.sex=="女"){
					str+="♀";
				}
				str+=item.age.toString();
				return str;
			},
			getTypeBySex(item){
				if(item.sex=="男"){
					return "primary";
				}else if(item.sex=="女"){
					return "error";
				}
				return "error";
			}
		}
	}
</script>

<style>
</style>
